<template>
	
	<view class="container">
 <u-subsection  :list="list" :current="curNow" @change="sectionChange"></u-subsection>
		<uni-section :title="title3D" type="line" padding>  <span> </span>
			<view class="uni-flex uni-row"
				style="-webkit-justify-content: space-between;justify-content: space-between;">
				<view class="text">
					<view class="example-body">
						<view>
							<u-picker :show="showQiHao" :columns="qiHaoList" @confirm="confirm" itemHeight='50'>
							</u-picker>
							<view class="u-demo-block">
								<view class="u-demo-block__content" @click="showQiHaoTtrue">
									<u--input placeholder="点击选择历史期数" border="surround" shape="circle"
										v-model="qiHaoMeg"></u--input>
								</view>
							</view>
						</view>
					</view>
				</view>
				<view class="text">
					<view class="example-body">
						<view>
							<u-picker :show="showBiKai" :columns="bikaiList" @confirm="confirmBiKai" itemHeight='50'>
							</u-picker>
							<view class="u-demo-block">
								<view class="u-demo-block__content" @click="showBiKaiTrue" >
									<u--input placeholder="点击选择某个号码必开" border="surround" shape="circle"
										v-model="BiKaiMeg"></u--input>
								</view>
							</view>
						</view>
					</view>
				</view>
			</view>
			<view class="uni-padding-wrap uni-common-mt">
				<span>选号杀码</span>
				<uni-badge class="uni-badge-left-margin" :inverted=clickLin text="0" type="success"
					@click="clickCardLin" />
				<uni-badge class="uni-badge-left-margin" :inverted=clickYi text="1" type="success"
					@click="clickCardYi" />
				<uni-badge class="uni-badge-left-margin" :inverted=clickEr text="2" type="success"
					@click="clickCardEr" />
				<uni-badge class="uni-badge-left-margin" :inverted=clickSan text="3" type="success"
					@click="clickCardSan" />
				<uni-badge class="uni-badge-left-margin" :inverted=clickSi text="4" type="success"
					@click="clickCardSi" />
				<uni-badge class="uni-badge-left-margin" :inverted=clickWu text="5" type="success"
					@click="clickCardWu" />
				<uni-badge class="uni-badge-left-margin" :inverted=clickLiu text="6" type="success"
					@click="clickCardLiu" />
				<uni-badge class="uni-badge-left-margin" :inverted=clickQi text="7" type="success"
					@click="clickCardQi" />
				<uni-badge class="uni-badge-left-margin" :inverted=clickBa text="8" type="success"
					@click="clickCardBa" />
				<uni-badge class="uni-badge-left-margin" :inverted=clickJiu text="9" type="success"
					@click="clickCardJiu" />
			</view>
			<view class="uni-padding-wrap uni-common-mt">
				<button type="primary" @click="submit">开始分析</button>
			</view>
			<!-- <view class="uni-padding-wrap uni-common-mt">
				<view class="uni-btn-v">
					<navigator url="echarsSanB/echarsSanB?title=navigate" hover-class="navigator-hover">
						<button type="primary">近20期的号码在1100期内的图表</button>
					</navigator>
				</view>
			</view> -->
			
			
			
			<view class="uni-flex uni-row"
				style="-webkit-justify-content: space-between;justify-content: space-between;">
				<view class="text">
						<view class="uni-btn-v">
							<navigator url="echarsSanB/echarsSanB?title=navigate" hover-class="navigator-hover">
								<button type="primary">20--1100图表</button>
							</navigator>
						</view>
				</view>
				<view class="text">
						<view class="uni-btn-v">
							<navigator url="echarsSanB/echarsSanBRE?title=navigate" hover-class="navigator-hover">
								<button type="primary">60--2500图表</button>
							</navigator>
						</view>
				</view>
			</view>
			

		</uni-section>
		<uni-section title="只有对子" type="line" padding v-if=" yesNumbList[0]">
			<span  v-for="site in yesNumbList"> 
			   <text >{{ "    "+site+"    " }},</text>
			 </span>
		</uni-section>
		<uni-section title="没有对子" type="line" padding  v-if=" noNumbList[0]">
			<span  v-for="site in noNumbList"> <text >{{ "    "+site+"    " }},</text></span>
		</uni-section>
		<uni-section title="某个号码必开的集合" type="line" padding v-if=" numbfonum[0]">
			<span  v-for="site in numbfonum"> <text >{{ "    "+site+"    " }},</text></span>
		</uni-section>


		<u-notify ref="uNotify"></u-notify>


	</view>
</template>

<script>
	export default {
		components: {},
		data() {
			return {
				title3D:"3D",
				show: false,
				qiHaoMeg: '',
				showQiHao: false, //期号的下拉框
				showBiKai: false, //必开下拉
				BiKaiMeg: '',
				qiHaoList: [
					['500', '800', '1100', '1500', '1800', '2200', '2500','0']
				],
				title: 'navigator',
				yesNumbList: [],
				noNumbList: [],
				numbfonum: [],
				value: 'adasdasdas',
				bikaiList: [
					['0', '1', '2', '3', '4', '5', '6', '7', '8', '9']
				],
				QuerySanDReq: {
					nubm: '', //必开的某个号
					ShaNubm: [], //杀号*
					qishu: '' //查询的期数
				},
				clickLin: true,
				nubmLin: "",

				clickYi: true,
				nubmYi: "",

				clickEr: true,
				nubmEr: "",

				clickSan: true,
				nubmSan: "",

				clickSi: true,
				nubmSi: "",

				clickWu: true,
				nubmWu: "",

				clickLiu: true,
				nubmLiu: "",

				clickQi: true,
				nubmQi: "",

				clickBa: true,
				nubmBa: "",

				clickJiu: true,
				nubmJiu: "",

                list: ['3D', '排列3'],
				curNow: 0

			};
		},
		methods: {
			sectionChange(index) {
				this.curNow = index;
				if(index==1){
					this.title3D="排列3"
				}
				if(index==0){
					this.title3D="3D"
				}
				
			},
			confirmBiKai(e) {
			 this.showBiKai = false
				this.BiKaiMeg = e.value + ''
			},
			// 回调参数为包含columnIndex、value、values
			confirm(e) {
				this.showQiHao = false
				this.qiHaoMeg = e.value + ''
			},
			showBiKaiTrue(){
				 uni.hideKeyboard();//隐藏软键盘
				this.showBiKai=true
			},
			showQiHaoTtrue(){
				 uni.hideKeyboard();//隐藏软键盘
				 this.showQiHao=true
			},
			async submit() {
				
				if (this.qiHaoMeg != "") {
					uni.showLoading({ //开启动画
					 title: '分析中' //动画提示文字
					});
					this.QuerySanDReq.qishu = this.qiHaoMeg

					if (this.BiKaiMeg != "") {
						this.QuerySanDReq.nubm = this.BiKaiMeg
					}
					if (this.nubmLin != "") {
						this.QuerySanDReq.ShaNubm.push(this.nubmLin)
					}
					if (this.nubmYi != "") {
						this.QuerySanDReq.ShaNubm.push(this.nubmYi)
					}
					if (this.nubmEr != "") {
						this.QuerySanDReq.ShaNubm.push(this.nubmEr)
					}
					if (this.nubmSan != "") {
						this.QuerySanDReq.ShaNubm.push(this.nubmSan)
					}
					if (this.nubmSi != "") {
						this.QuerySanDReq.ShaNubm.push(this.nubmSi)
					}
					if (this.nubmWu != "") {
						this.QuerySanDReq.ShaNubm.push(this.nubmWu)
					}
					if (this.nubmLiu != "") {
						this.QuerySanDReq.ShaNubm.push(this.nubmLiu)
					}
					if (this.nubmQi != "") {
						this.QuerySanDReq.ShaNubm.push(this.nubmQi)
					}
					if (this.nubmBa != "") {
						this.QuerySanDReq.ShaNubm.push(this.nubmBa)
					}
					if (this.nubmJiu != "") {
						this.QuerySanDReq.ShaNubm.push(this.nubmJiu)
					}


					//发起post方式的请求
					uni.request({
						//url:  'http://114.132.55.180:443/sand/chart/selectSanD/coldHot', 
						url: 'http://114.132.55.180:443/sand/chart/selectSanD/coldHot',
						header: {
							'content-type': 'application/x-www-form-urlencoded'
						},
						data: {
							qishu: this.QuerySanDReq.qishu,
							nubm: this.QuerySanDReq.nubm,
							ShaNubm: this.QuerySanDReq.ShaNubm
						},
						method: 'POST',

						success: (res) => {
							uni.hideLoading(); //动画关闭
							this.yesNumbList = res.data.yesNumbList
							this.noNumbList = res.data.noNumbList
							this.numbfonum = res.data.numbfonum
							if (res.data.success) {

							} else {}

						},
						fail: (res) => {

						}
					});
					this.QuerySanDReq.ShaNubm = []
				} else {
					this.$refs.uNotify.show({
						top: 20,
						message: '查询条件期号不能为空，请选择！',
					 type: 'error',
						color: '#ffffff',
						bgColor: '',
						fontSize: 14,
						duration: 1500,
						safeAreaInsetTop: true
					})

				}
			},

			clickCardLin() {
				if (this.clickLin) {
					this.clickLin = false
					this.nubmLin = "0"
				} else {
					this.nubmLin = ""
					this.clickLin = true
				}
			},
			clickCardYi() {
				if (this.clickYi) {
					this.clickYi = false
					this.nubmYi = "1"
				} else {
					this.nubmYi = ""
					this.clickYi = true
				}
			},
			clickCardEr() {
				if (this.clickEr) {
					this.clickEr = false
					this.nubmEr = "2"
				} else {
					this.nubmEr = ""
					this.clickEr = true
				}
			},
			clickCardSan() {
				if (this.clickSan) {
					this.clickSan = false
					this.nubmSan = "3"
				} else {
					this.nubmSan = ""
					this.clickSan = true
				}
			},
			clickCardSi() {
				if (this.clickSi) {
					this.clickSi = false
					this.nubmSi = "4"
				} else {
					this.nubmSi = ""
					this.clickSi = true
				}
			},
			clickCardWu() {
				if (this.clickWu) {
					this.clickWu = false
					this.nubmWu = "5"
				} else {
					this.nubmWu = ""
					this.clickWu = true
				}
			},
			clickCardLiu() {
				if (this.clickLiu) {
					this.clickLiu = false
					this.nubmLiu = "6"
				} else {
					this.nubmLiu = ""
					this.clickLiu = true
				}
			},
			clickCardQi() {
				if (this.clickQi) {
					this.clickQi = false
					this.nubmQi = "7"
				} else {
					this.nubmQi = ""
					this.clickQi = true
				}
			},
			clickCardBa() {
				if (this.clickBa) {
					this.clickBa = false
					this.nubmBa = "8"
				} else {
					this.nubmBa = ""
					this.clickBa = true
				}
			},
			clickCardJiu() {
				if (this.clickJiu) {
					this.clickJiu = false
					this.nubmJiu = "9"
				} else {
					this.nubmJiu = ""
					this.clickJiu = true
				}
			}

		},
		mounted() {


		}
	};
</script>

<style lang="scss">
 view {
 	white-space: normal;  // 规定段落中的文本不进行换行
 	word-break: break-all;  // 允许单词中换行，在容器的最右边进行断开不会浪费控件
 	word-wrap: break-word;  // 防止长单词溢出，单词内部短句
 }
</style>
